<template>
  <el-container>
    <!-- 头部 -->
    <el-header style="height: 62px;">
      <div class="home_box_header">
        <h2 class="home_title" style=" color: #2dafcb">HAPPY</h2>
        <br />
        <h2 class="home_title" style=" color: #fff">MMALL</h2>
      </div>
      <!-- 登录 -->
      <div class="header_welcome">
        <el-popover placement="top" width="160" v-model="visible">
          <p>您是否要退出登录？</p>
          <div style="text-align: right; margin: 0">
            <el-button size="mini" type="text" @click="visible = false">取消</el-button>
            <el-button type="primary" size="mini" @click="visibletrue">确定</el-button>
          </div>
          <el-button slot="reference">
            <p>
              <i class="el-icon-menu"></i>
              <span>欢迎，admin</span>
              <i class="el-icon-caret-bottom"></i>
            </p>
          </el-button>
        </el-popover>
      </div>
    </el-header>

    <el-container>
      <el-aside width="20%">
        <!-- 左边区域 -->
        <el-col :span="24">
          <!-- <h5>自定义颜色</h5> -->
          <el-menu
            default-active="/"
            class="el-menu-vertical-demo"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#4cb1cf"
            router
          >
            <el-menu-item index="/">
              <i class="el-icon-menu"></i>
              <span slot="title">首页</span>
            </el-menu-item>
            <!-- 下拉导航 -->
            <el-submenu index="2">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>商品</span>
              </template>
              <el-menu-item index="/Commodity">
                <span slot="title">商品管理</span>
              </el-menu-item>
              <el-menu-item index="/Category">
                <span slot="title">品类管理</span>
              </el-menu-item>
            </el-submenu>

            <el-submenu index="3">
              <template slot="title">
                <i class="el-icon-document"></i>
                <span>订单</span>
              </template>
              <el-menu-item index="/Order">
                <span slot="title">订单管理</span>
              </el-menu-item>
            </el-submenu>

            <el-submenu index="4">
              <template slot="title">
                <i class="el-icon-setting"></i>
                <span>用户</span>
              </template>
              <el-menu-item index="/Userback">
                <span slot="title">用户列表</span>
              </el-menu-item>
            </el-submenu>
          </el-menu>
        </el-col>
      </el-aside>
      <el-main>
        <!-- 内容部分 -->
        <keep-alive>
          <router-view />
        </keep-alive>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  name: "Home",
  data() {
    return {
      visible: false, //登录
      
    };
  },
  methods: {
    visibletrue() {
      localStorage.removeItem("admin");
      this.visible = false;
      this.$router.push({
        path: "/Login",
      });
    },
  },
};
</script>

<style lang="scss" scoped>
@import "@/Scss/index.scss";
.el-header,
.el-footer {
  // background-color: #b3c0d1;
  color: #333;
  text-align: left;
  line-height: 30px;
  padding: 0 0;
  display: flex;
}
.el-aside {
  @include bgColor(rgb(92, 90, 90));
  color: #333;
  text-align: left;
  line-height: 30px;
}

.el-main {
  background-color: rgb(238, 238, 238);
  color: #333;
  // line-height: 30px;
  padding: 0px;
  overflow: hidden;
  clear: both;
  // box-sizing: border-box;
}
/deep/ .home_title {
  padding-left: 20px;
  display: inline;
}
.header_welcome {
  // @include Size(80%, 60px);
  @include bgColor(#ffff);
  // @include border(1px, solid, #cdcdcd);
  margin-left: 1000px;
  margin-top: 10px;
}
// .header_welcome > p {
//   position: absolute;
//   right: 80px;
//   // top: 62px;
// }
.home_box_header {
  width: 19.99%;
  height: 62px;
  // padding-right:50px ;
  // background: indianred;
  @include bgColor(rgb(92, 90, 90));
}
</style>